from django import newforms as forms
from nexo.wiki.models import *

class NewPageForm(forms.Form):
	name = forms.CharField(max_length = 200, label = "page's name", help_text = "200 characters max.")
	content = forms.CharField(label = "page's contents", widget = forms.Textarea)
	namespaces = Namespace.objects.all()
	namespace_choices = [['','----']]
	for i in namespaces:
		namespace_choices.append([ i.name, i.name])
	namespace = forms.ChoiceField(label = "page's namespace", choices = namespace_choices, required = False)
#	author = forms.CharField(label = "page's author")
	#modificationDate =	 


# A simpler form wich help us not showing the name of the page and the namespace as form fields.
class PageForm(forms.Form):
	name = forms.CharField(max_length = 200, widget = forms.HiddenInput)
	content = forms.CharField(label = "page's contents", widget = forms.Textarea)
	namespace = forms.CharField(max_length = 200, widget = forms.HiddenInput, required = False)
